import { createApp } from "vue";
import pinia from "./stores";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import App from "./App.vue";
import router from "./router";
import "./styles/index.scss";
import ElSvg from "./components/SvgIcon/ElSvg";
import "./permission";
import CategorySelector from "@/components/CategorySelector/index.vue";
import has from "@/directives/has"; // 按钮权限控制相关指令

const app = createApp(App);

app.use(ElSvg); // 使用封装的element-plus-icon
app.component("CategorySelector", CategorySelector); // 全局注册分类选择器
app.use(pinia)
    .use(router)
    .use(ElementPlus, {
        locale: zhCn,
    })
    .use(has)
    .mount("#app");
